﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ALiOssNet6;

public interface IOss
{
    Task<bool> IsExistedAsync(string bucketName, string filename);
    Task<bool> SaveAsync(string bucketName, string filename, byte[] bytes) => SaveAsync(bucketName, filename, new MemoryStream(bytes));
    Task<bool> SaveAsync(string bucketName, string filename, Stream stream);
    Task<bool> SavePublicReadAsync(string bucketName, string filename, byte[] bytes) => SavePublicReadAsync(bucketName, filename, new MemoryStream(bytes));
    Task<bool> SavePublicReadAsync(string bucketName, string filename, Stream stream);

    Task<FileMetas?> GetMetasAsync(string bucketName, string directoryName = "", string delimiter = "");
    Task<byte[]?> GetAsync(string bucketName, string filename);
    Task<bool> DeleteAsync(string bucketName, string filename);
    Task<bool> DeleteBucketAsync(string bucketName);
}
